package Cn.Sarkar.MMS.Entities.Independent.Permission

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Permission.Permissions
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.MMS.Independent.Permission.IPermission
import Cn.Sarkar.Entities.MMS.Independent.Permission.IPermissionGroup
import Cn.Sarkar.Entities.MMS.Independent.Permission.IPermissionItem

class Permission(DataContext: IDataContext) : BaseEntity(DataContext, Permissions), IPermission {
    var permissionGroupID by Permissions.PermissionGroupID
    override var permissionGroup: IPermissionGroup by hasOne(Permissions.PermissionGroupID) { PermissionGroup(it) }
    var permissionItemID by Permissions.PermissionItemID
    override var permissionItem: IPermissionItem by hasOne(Permissions.PermissionItemID) { PermissionItem(it) }
}